package ycl.important.controller.region;


import com.github.xiaoymin.knife4j.annotations.ApiSort;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import ycl.important.common.ApiResult;
import ycl.important.common.base.controller.BaseController;
import ycl.important.entity.region.CarsAttribution;
import ycl.important.service.region.CarsAttributionService;

import javax.annotation.Resource;

/**
 * <p>
 * 车辆归属地 前端控制器
 * </p>
 *
 * @author YCL
 * @since 2021-06-07
 */
@RestController
@RequestMapping("/region/cars-attribution")
@Api(tags = "地区 - 车辆归属地")
@ApiSort(5)
public class CarsAttributionController extends BaseController {

	@Resource
	private CarsAttributionService carsAttributionService;

	@Override
	public ApiResult<CarsAttribution> getById(Long id) {
		return ApiResult.success(carsAttributionService.getById(id));
	}

	@PostMapping("/insertAll")
	public ApiResult<Object> insertAll(){
		carsAttributionService.insertAll();
		return ApiResult.success();
	}
}

